package com.ruoyi.health.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.health.domain.Family;
import com.ruoyi.health.domain.User;
import com.ruoyi.health.mapper.FamilyMapper;
import com.ruoyi.health.service.IFamilyService;
import com.ruoyi.health.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 家人 Controller
 * 
 * @author libin
 * @date 2023-08-21
 */
@RestController
@RequestMapping("/health/healthFamily")
public class FamilyController extends BaseController
{
    @Autowired
    private IFamilyService familyService;

    /**
     * 查询家人 列表
     */
    @PreAuthorize("@ss.hasPermi('health:healthUser:list')")
    @GetMapping("/list/{userId}")
    public TableDataInfo list(@PathVariable Long userId)
    {
        startPage();  //支持分页
        List<Family> familyList = familyService.selectFamilyListByUserId(userId);
        return getDataTable(familyList);
    }




}
